package visitors;

/**
 *
 * Author: William
 * Date:   20-Mar-2010
 *
 */

public class ErrorHandler
{
    private static int errorCount = 0;

    public static void complain(String msg)
    {
        errorCount++;
        System.out.println(msg);
    }

    public static void summary()
    {
        if (errorCount > 1) System.out.println("There were " + errorCount + " errors in this code.");
        else if (errorCount == 1) System.out.println("There was 1 error in this code.");
    }

    public static void reset()
    {
        errorCount = 0;
    }

}
